#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>

int main(int argc, char const *argv[])
{
    pid_t pid = fork();
    int a = 0;
    char b = 'A';
    //子进程
    if (pid == 0)
    {
        while (1)
        {
            printf("%c",b);
            fflush(stdout);
            c++;
            if (b > 'Z')
            {
                b = 'A';
            }
            sleep(1);
        }
    }
    //父进程
    else if(pid > 0)
    {
        int num = 0;
        while (1)
        {
            printf("%d",num);
            fflush(stdout);
            num++;
            if (num > 9)
            {
                num = 0;
            }
            sleep(1);
        }
    }
    //fork失败
    else
    {
        perror("fork failed");
        return 1;
    }
    return 0;
}